﻿@model Orders
@inject NetCoreCMS.IServices.IPaymentService _payment
@inject NetCoreCMS.IServices.IExpressService _express
@inject NetCoreCMS.IServices.IOrdersService _orders
@inject NetCoreCMS.IServices.IArticleService _article
@{
    Layout = null;
    Sysconfig config = ViewData["config"] as Sysconfig;
}
<!DOCTYPE html>
<!--HTML5 doctype-->
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <title>查看订单</title>
    <link rel="stylesheet" type="text/css" href="/mobile/css/style.css" />
    <script type="text/javascript" charset="utf-8" src="/mobile/js/zepto.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="/mobile/js/weui.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="/mobile/js/common.js"></script>
</head>

<body ontouchstart>
    <div class="page">
        <!--页面头部-->
        <div class="header">
            <a class="back" href="javascript:history.back();">
                <i class="iconfont icon-arrow-left"></i>
            </a>
            <h3>我的订单</h3>
            <div class="right">
                <a class="weui-cell_access weui-cell_link" asp-controller="Usercenter" asp-action="Index" asp-route-act="index">
                    <i class="iconfont icon-user"></i>
                </a>
            </div>
        </div>
        <!--/页面头部-->

        <div class="page__bd">

            <!--收货信息-->
            <div class="weui-form-preview form-preview" style="margin-top:10px;">
                <div class="weui-form-preview__bd">
                    <div class="weui-form-preview__item">
                        <label class="weui-form-preview__label">收货人</label>
                        <span class="weui-form-preview__value">@Model.accept_name</span>
                    </div>
                    <div class="weui-form-preview__item">
                        <label class="weui-form-preview__label">收货地址</label>
                        <span class="weui-form-preview__value">@Model.area @Model.address @Model.post_code</span>
                    </div>
                    <div class="weui-form-preview__item">
                        <label class="weui-form-preview__label">联系电话</label>
                        <span class="weui-form-preview__value">@Model.mobile @Model.telphone</span>
                    </div>
                    <div class="weui-form-preview__item">
                        <label class="weui-form-preview__label">电子邮箱</label>
                        <span class="weui-form-preview__value">@Model.email</span>
                    </div>
                    <div class="weui-form-preview__item">
                        <label class="weui-form-preview__label">开具发票</label>
                        <span class="weui-form-preview__value">
                            @if (Model.is_invoice == 1)
                            {
                                @:是
                            }
                            else
                            {
                                @:否
                            }
                        </span>
                    </div>
                    @if (Model.is_invoice == 1)
                    {
                        <div class="weui-form-preview__item">
                            <label class="weui-form-preview__label">发票抬头</label>
                            <span class="weui-form-preview__value">@Model.invoice_title</span>
                        </div>
                    }
                    <div class="weui-form-preview__item">
                        <label class="weui-form-preview__label">备注留言</label>
                        <span class="weui-form-preview__value">@Model.message</span>
                    </div>
                </div>
            </div>
            <!--收货信息-->
            <!--订单概述-->
            <div class="weui-form-preview form-preview">
                <div class="weui-form-preview__bd">
                    <div class="weui-form-preview__item">
                        <label class="weui-form-preview__label">支付方式</label>
                        <span class="weui-form-preview__value">@_payment.GetModel(Model.payment_id).title</span>
                    </div>
                    @if (Model.payment_status == 2)
                    {
                        <div class="weui-form-preview__item">
                            <label class="weui-form-preview__label">付款时间</label>
                            <span class="weui-form-preview__value">@Model.payment_time</span>
                        </div>
                    }
                    @if (Model.express_status == 2)
                    {
                        <div class="weui-form-preview__item">
                            <label class="weui-form-preview__label">发货单号</label>
                            <span class="weui-form-preview__value">@_express.GetModel(Model.express_id).title @Model.express_no</span>
                        </div>
                        <div class="weui-form-preview__item">
                            <label class="weui-form-preview__label">物流信息</label>
                            <span class="weui-form-preview__value">@ViewBag.expressdetail</span>
                        </div>
                    }
                </div>
            </div>
            <!--订单概述-->
            <!--订单信息-->
            <div class="weui-form-preview form-preview">
                <div class="weui-form-preview__bd">
                    <div class="weui-form-preview__item">
                        <label class="weui-form-preview__label">商品金额</label>
                        <span class="weui-form-preview__value">¥@Model.real_amount 元</span>
                    </div>
                    <div class="weui-form-preview__item">
                        <label class="weui-form-preview__label">税费</label>
                        <span class="weui-form-preview__value">¥@Model.invoice_taxes 元</span>
                    </div>
                    <div class="weui-form-preview__item">
                        <label class="weui-form-preview__label">运费</label>
                        <span class="weui-form-preview__value">¥@Model.express_fee 元</span>
                    </div>
                    <div class="weui-form-preview__item">
                        <label class="weui-form-preview__label">支付手续费</label>
                        <span class="weui-form-preview__value">¥@Model.payment_fee 元</span>
                    </div>
                    <div class="weui-form-preview__item">
                        <label class="weui-form-preview__label">总积分</label>
                        <span class="weui-form-preview__value">@Model.point 分</span>
                    </div>
                </div>
            </div>
            <!--订单信息-->
            <!--商品列表-->
            <div class="detail-list">
                <ul>
                    <li>
                        <div class="detail-hd">
                            <span class="fr">@_orders.get_order_status(Model.id)</span>
                            <span>@Model.order_no</span>
                        </div>
                        <div class="detail-bd">
                            @if (Model.order_goods != null)
                            {
                                @foreach (Order_goods modelt in Model.order_goods)
                                {
                                    var pmodel = _article.GetModel(modelt.article_id);
                                    string imgurl = "";
                                    if (pmodel != null)
                                        imgurl = pmodel.img_url;
                                    <div class="list-box">
                                        <div class="img-box">
                                            <a asp-controller="Goods" asp-action="Show" asp-route-id="@modelt.article_id"><img src="@imgurl" /></a>
                                        </div>
                                        <div class="txt-box">
                                            <h2>@modelt.goods_title</h2>
                                            <p>@modelt.spec_text</p>
                                            <p class="note">
                                                <span class="fr">×@modelt.quantity</span>
                                                <span class="price">￥@modelt.real_price</span>
                                            </p>
                                        </div>
                                    </div>
                                }
                            }
                        </div>
                        <div class="detail-ft">
                            <p class="fr">订单总金额：¥@Model.order_amount 元</p>
                            <p>@Model.add_time</p>
                            <div class="ft-btn">
                                <div class="btn-box">
                                    @if (Model.express_status != 2)
                                    {
                                        <a href="/Web/UserOrder/Edit/@Model.id">修改地址</a>
                                    }
                                    @if (_orders.get_order_payment_status(Model.id))
                                    {
                                        <a href="/Web/Payment/Index?action=confirm&order_no=@Model.order_no">去付款</a>
                                    }
                                    @if (Model.status < 2)
                                    {
                                        <a href="javascript:;" onclick="clickSubmit('/order_ajax/index?action=order_cancel&order_no=@Model.order_no');">取消订单</a>
                                    }
                                </div>
                            </div>
                        </div>
                    </li>
                </ul>
            </div>
            <!--/商品列表-->

        </div>

        <!--版权信息-->
        @await Html.PartialAsync("~/Areas/Web/Views/Shared/_Copyright.cshtml")
        <!--/版权信息-->
        <!--底部导航-->
        @await Html.PartialAsync("~/Areas/Web/Views/Shared/_Footer.cshtml")
        <!--/底部导航-->
    </div>
</body>
</html>
